export class JdkReleaseFile {
  private _values: Dict<string> = {};

  constructor(public path: string) {}

  async load() {
    const text = await native.fs.readFileText(this.path);
    const lines = text.split("\n");
    for (let line of lines) {
      line = line.trim();
      if (!line) continue;
      const [key, value] = line.split("=");
      this._values[key] = value?.replace(/^"|"$/g, "");
    }
  }

  get(key: string) {
    return this._values[key];
  }
}
